<div class="layuimini-container">
    <div class="layuimini-main">
        <fieldset id="searchFieldset_currentTable" class="table-search-fieldset layui-hide">
            <legend>{:lang("common.condition_search")}</legend>
            <form class="layui-form layui-form-pane form-search">
                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("common.create_time")}</label>
                    <div class="layui-input-inline">
                        <input name="u_create_time_range" class="layui-input"
                               placeholder="{:lang('common.choose')}{:lang('common.create_time')}"
                               data-date data-date-range="-">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("upload.original_name")}</label>
                    <div class="layui-input-inline">
                        <input name="u_original_name_like"
                               placeholder="{:lang('common.input')}{:lang('upload.original_name')}" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("upload.file_ext")}</label>
                    <div class="layui-input-inline">
                        <input name="u_file_ext_like"
                               placeholder="{:lang('common.input')}{:lang('upload.file_ext')}" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-inline" style="margin-left:50px">
                    <button type="submit" class="layui-btn layui-btn-normal" data-type="tableSearch"
                            lay-submit lay-filter="search_currentTable">{:lang("common.btn_search")}
                    </button>
                </div>
            </form>
        </fieldset>

        <table id="currentTable"
               data-auth-add="{:auth(request()->controller().'/add')}"
               data-auth-delete="{:auth(request()->controller().'/delete')}"
               data-auth-print="{:auth(request()->controller().'/print')}">
        </table>
    </div>
</div>
<script>
    layui.use(['myCommon'], function () {
        let myCommon = layui.myCommon;
        myCommon.table.render({
            where: myCommon.generateCondition()
            , cols: [[
                {type: "checkbox"},
                {field: 'id', width: 80, title: '{:lang("common.id")}', sort: true},
                {
                    field: 'url',
                    minWidth: 80,
                    search: false,
                    title: '{:lang("upload.image_info")}',
                    templet: myCommon.table.image
                },
                {field: 'url', minWidth: 120, title: '{:lang("upload.url")}', templet: myCommon.table.url, sort: true},
                {field: 'original_name', minWidth: 80, title: '{:lang("upload.original_name")}', sort: true},
                {field: 'mime_type', minWidth: 80, title: '{:lang("upload.mime_type")}', sort: true},
                {field: 'file_ext', minWidth: 80, title: '{:lang("upload.file_ext")}', sort: true},
                {field: 'create_time', minWidth: 80, title: '{:lang("common.create_time")}'},
                {width: 90, title: '{:lang("common.operate")}', templet: myCommon.table.tool, operat: ['delete']}
            ]]
        });
        myCommon.listen();
    });
</script>
